package org.kk.controller;

import com.kk.entities.Payment;
import com.kk.model.result.GlobalResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * the type of springcloud-alibaba
 *
 * <p>
 * .
 *
 * @author 铁甲小宝
 * @date 2023-02-13
 */
@RestController
public class ProviderController {

    @GetMapping("/getPaymentById/{id}")
    private GlobalResult<Payment> getPaymentById(@PathVariable("id") int id){
        if (id == 0){
            throw new NullPointerException();
        }
        return new GlobalResult<>("200","成功",new Payment(id,"Good" + id));
    }
}
